import { createStore, combineReducers, applyMiddleware } from "@reduxjs/toolkit";
import listReducer from "./list/listReducer";
import { useSelector, TypedUseSelectorHook } from "react-redux";
import thunk from 'redux-thunk'
const reducer = combineReducers({
	list: listReducer
})
const store = createStore(reducer, applyMiddleware(thunk))

export type RootState = ReturnType<typeof store.getState>;

export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

export default store;
